package com.yanqu.road.server.cmd.activity.hsisland;

import com.yanqu.road.exception.BusinessException;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.HsIslandProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.activity.hsisland.CrossHsIslandActivity;
import com.yanqu.road.server.manager.activity.hsisland.CrossHsIslandActivityMgr;
import com.yanqu.road.server.manager.activity.hsisland.CrossHsIslandUser;
import com.yanqu.road.server.manager.activity.hsisland.pb.CrossHsIslandActivityPb;
import com.yanqu.road.server.protocol.GameErrorCode;
import com.yanqu.road.server.protocol.Protocol;
import com.yanqu.road.utils.YanQuMessageUtils;

@Cmd(code = Protocol.C2_HS_ISLAND_AFTER_LOGIN_HANDLE, desc = "海神岛-登录后处理")
public class CrossHsIslandAfterLoginHandleCmd extends CrossUnionCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        HsIslandProto.HsIslandAfterLoginHandleCrossReqMsg reqMsg = HsIslandProto.HsIslandAfterLoginHandleCrossReqMsg.parseFrom(packet.getBytes());
        CrossHsIslandActivity activity = CrossHsIslandActivityMgr.getActivity(reqMsg.getActivityId(), groupId);
        if (activity == null) {
            return;
        }
        //商会成就更新
        activity.syncUserChangeUnionAchievement(packet.getPlayerId());
        //基金分更新
        activity.syncUserChangeFundScore(packet.getPlayerId());
        //同步玩家数据
        activity.syncUserData(packet.getPlayerId());
        //同步红点
        activity.syncUserRedDot(packet.getPlayerId());
    }

    @Override
    public void sendData() {}
}
